﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SanQiOther.Models;
using System.Data.Entity;

namespace SanQiOther.Controllers
{
    public class DormitoryController : Controller
    {
        private RewardDbContext db = new RewardDbContext();
        // GET: Dormitory
        public ActionResult Index()
        {
            var member = db.dict_Dormitory.OrderBy(r => r.type).ThenBy(r => r.mc);
            return View(member.ToList());
        }

        public ActionResult Detail(int id)
        {
            var v_dict_Dormitory_Detail = db.v_dict_Dormitory_Detail.Where(r => r.Dormitory == id.ToString()).OrderByDescending(r => r.IsUsing);
            return View(v_dict_Dormitory_Detail.ToList());
        }
    }
}